package com.hksj.common.core.common;

/**
 * 数据库状态
 */
public enum Status {

    /**
     * 启用
     */
    ENABLE(0,"启用"),

    /**
     * 禁用
     */
    DISABLE(1,"禁用");

    private final Integer value;
    private final String code;

    Status(Integer value, String code){
        this.value = value;
        this.code = code;
    }

    public Integer value(){
        return this.value;
    }

    public String code(){return this.code;}

    public static String getCodeByValue(Integer value){
        for (Status status : values()) {
            if (status.value().equals(value)) {
                return status.code();
            }
        }
        return null;
    }
}
